#!/usr/bin/python
import sys
from socket import *
serverHost = 'localhost'
serverPort = 51769

message = ['hello']

if len(sys.argv)>1:
    serverHost = sys.argv[1]
    if len(sys.argv)>2:
        message = sys.argv[2:]

sockobj = socket(AF_INET, SOCK_STREAM)
sockobj.connect((serverHost, serverPort))
for line in message:
    sockobj.send(line)
    data = sockobj.recv(1024)
    print 'client got:', `data`

sockobj.close()
